
<!DOCTYPE html>
<html lang="zh-CN" class="loading">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>分类: leetcode百题计划 - peony&#39;s blogs</title>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate" />
    <meta name="keywords" content="peony,"> 
    
    <meta name="author" content="peony"> 
    <link rel="alternative" href="atom.xml" title="peony&#39;s blogs" type="application/atom+xml"> 
    <link rel="icon" href="/img/favicon63.png"> 
    
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">

    
<link rel="stylesheet" href="/css/diaspora.css">

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
         (adsbygoogle = window.adsbygoogle || []).push({
              google_ad_client: "ca-pub-8691406134231910",
              enable_page_level_ads: true
         });
    </script>
    <script async custom-element="amp-auto-ads"
        src="https://cdn.ampproject.org/v0/amp-auto-ads-0.1.js">
    </script>
<meta name="generator" content="Hexo 4.2.0"></head>

<body class="loading">
    <span id="config-title" style="display:none">peony&#39;s blogs</span>
    <div id="loader"></div>
    <div class="nav">
    <ul id="menu-menu" class="menu">
        
        <li class="pview menu-item menu-item-type-post_type menu-item-object-page">
            <a href="/whoami/" title="Whoami" target="_blank" rel="noopener">Whoami</a>
        </li>
        
        <li class="  menu-item menu-item-type-post_type menu-item-object-page">
            <a href="https://github.com/PPeony" title="Github(目前没有任何项目，除了这篇博客)" target="_blank" rel="noopener">Github(目前没有任何项目，除了这篇博客)</a>
        </li>
        
        <li class="  menu-item menu-item-type-post_type menu-item-object-page">
            <a href="https://leetcode-cn.com/u/peony-2/" title="leetcode" target="_blank" rel="noopener">leetcode</a>
        </li>
        
        <li class="  menu-item menu-item-type-post_type menu-item-object-page">
            <a href="https://blog.csdn.net/qq_15764477" title="CSDN" target="_blank" rel="noopener">CSDN</a>
        </li>
        
        <li class="pview menu-item menu-item-type-post_type menu-item-object-page">
            <a href="/categories/" title="分类" target="_blank" rel="noopener">分类</a>
        </li>
        
    </ul>
    <p id="copyright">
        &copy; 2020 peony.
        Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
        Theme <a href="https://github.com/Fechin/hexo-theme-diaspora" title="Diaspora" target="_blank" rel="noopener">Diaspora</a>
        by Fechin
    </p>
</div>

<div id="container">
    
<div id="screen">
    <div id="mark">
        <div class="layer" data-depth="0.4">
            <img src="/img/welcome-cover2.jpg" id="cover" crossorigin="anonymous" width="1920" height="1080">
        </div>
    </div>
    <div id="vibrant">
        <svg viewBox="0 0 2880 1620" height="100%" preserveAspectRatio="xMaxYMax slice">
            <polygon opacity="0.7" points="2000,1620 0,1620 0,0 600,0 "/>
        </svg>
        <div></div>
    </div>
    <div id="header">
        <div>
            <a class="image-logo" href="/"></a>
            <div class="icon-menu switchmenu"></div>
        </div>
    </div>
    
    <div id="post0">
        <p>四月 11, 2020</p>
        <h2><a href="/2020/04/11/leetcode%E9%9D%A2%E8%AF%95%E9%A2%9862-%E5%9C%86%E5%9C%88%E4%B8%AD%E6%9C%80%E5%90%8E%E5%89%A9%E4%B8%8B%E7%9A%84%E6%95%B0%E5%AD%97/" title="leetcode面试题62. 圆圈中最后剩下的数字" class="posttitle">leetcode面试题62. 圆圈中最后剩下的数字</a></h2>
        <p class="summary">leetcode面试题62. 圆圈中最后剩下的数字
约瑟夫环问题，这绝对是我最后一次了，肯定能会了。
给出一个好想...</p>
    </div>
    
</div>

    <div id="primary">
        
<div class="post">
    <a href="/2020/04/11/leetcode%E9%9D%A2%E8%AF%95%E9%A2%9862-%E5%9C%86%E5%9C%88%E4%B8%AD%E6%9C%80%E5%90%8E%E5%89%A9%E4%B8%8B%E7%9A%84%E6%95%B0%E5%AD%97/" title="leetcode面试题62. 圆圈中最后剩下的数字">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>四月 11, 2020</p>
        <h3><a href="/2020/04/11/leetcode%E9%9D%A2%E8%AF%95%E9%A2%9862-%E5%9C%86%E5%9C%88%E4%B8%AD%E6%9C%80%E5%90%8E%E5%89%A9%E4%B8%8B%E7%9A%84%E6%95%B0%E5%AD%97/" title="leetcode面试题62. 圆圈中最后剩下的数字" class="posttitle">leetcode面试题62. 圆圈中最后剩下的数字</a></h3>
        <p>leetcode面试题62. 圆圈中最后剩下的数字
约瑟夫环问题，这绝对是我最后一次了，肯定能会了。
给出一个好想的方法，不用模拟链表，直接用取模模拟过程...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/04/11/leetcode337-%E6%89%93%E5%AE%B6%E5%8A%AB%E8%88%8D-III/" title="leetcode337. 打家劫舍 III">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>四月 11, 2020</p>
        <h3><a href="/2020/04/11/leetcode337-%E6%89%93%E5%AE%B6%E5%8A%AB%E8%88%8D-III/" title="leetcode337. 打家劫舍 III" class="posttitle">leetcode337. 打家劫舍 III</a></h3>
        <p>leetcode337. 打家劫舍 III

在上次打劫完一条街道之后和一圈房屋后，小偷又发现了一个新的可行窃的地区。这个地区只有一个入口，我们称之为“根...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/04/11/leetcode-95-%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91-II/" title="leetcode 95. 不同的二叉搜索树 II">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>四月 11, 2020</p>
        <h3><a href="/2020/04/11/leetcode-95-%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91-II/" title="leetcode 95. 不同的二叉搜索树 II" class="posttitle">leetcode 95. 不同的二叉搜索树 II</a></h3>
        <p>leetcode 95. 不同的二叉搜索树 II

给定一个整数 n，生成所有由 1 … n 为节点所组成的二叉搜索树。


示例:


输入: 3输出:...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/04/11/leetcode96-%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91/" title="leetcode96. 不同的二叉搜索树">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>四月 11, 2020</p>
        <h3><a href="/2020/04/11/leetcode96-%E4%B8%8D%E5%90%8C%E7%9A%84%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91/" title="leetcode96. 不同的二叉搜索树" class="posttitle">leetcode96. 不同的二叉搜索树</a></h3>
        <p>leetcode96. 不同的二叉搜索树

给定一个整数 n，求以 1 … n 为节点组成的二叉搜索树有多少种？


示例:


输入: 3输出: 5解释...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/03/22/leetcode5366-%E6%A3%80%E6%9F%A5%E7%BD%91%E6%A0%BC%E4%B8%AD%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E6%9C%89%E6%95%88%E8%B7%AF%E5%BE%84/" title="leetcode5366. 检查网格中是否存在有效路径">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>三月 22, 2020</p>
        <h3><a href="/2020/03/22/leetcode5366-%E6%A3%80%E6%9F%A5%E7%BD%91%E6%A0%BC%E4%B8%AD%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%E6%9C%89%E6%95%88%E8%B7%AF%E5%BE%84/" title="leetcode5366. 检查网格中是否存在有效路径" class="posttitle">leetcode5366. 检查网格中是否存在有效路径</a></h3>
        <p>leetcode5366. 检查网格中是否存在有效路径

给你一个 m x n 的网格 grid。网格里的每个单元都代表一条街道。grid[i][j] 的...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/03/22/leetcode-1130-%E5%8F%B6%E5%80%BC%E7%9A%84%E6%9C%80%E5%B0%8F%E4%BB%A3%E4%BB%B7%E7%94%9F%E6%88%90%E6%A0%91/" title="leetcode 1130. 叶值的最小代价生成树">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>三月 22, 2020</p>
        <h3><a href="/2020/03/22/leetcode-1130-%E5%8F%B6%E5%80%BC%E7%9A%84%E6%9C%80%E5%B0%8F%E4%BB%A3%E4%BB%B7%E7%94%9F%E6%88%90%E6%A0%91/" title="leetcode 1130. 叶值的最小代价生成树" class="posttitle">leetcode 1130. 叶值的最小代价生成树</a></h3>
        <p>leetcode 1130. 叶值的最小代价生成树

给你一个正整数数组 arr，考虑所有满足以下条件的二叉树：


每个节点都有 0 个或是 2 个子节...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/03/22/leetcode652-%E5%AF%BB%E6%89%BE%E9%87%8D%E5%A4%8D%E7%9A%84%E5%AD%90%E6%A0%91/" title="leetcode652. 寻找重复的子树">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>三月 22, 2020</p>
        <h3><a href="/2020/03/22/leetcode652-%E5%AF%BB%E6%89%BE%E9%87%8D%E5%A4%8D%E7%9A%84%E5%AD%90%E6%A0%91/" title="leetcode652. 寻找重复的子树" class="posttitle">leetcode652. 寻找重复的子树</a></h3>
        <p>leetcode652. 寻找重复的子树

给定一棵二叉树，返回所有重复的子树。对于同一类的重复子树，你只需要返回其中任意一棵的根结点即可。


两棵树重...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/03/22/leetcode865-%E5%85%B7%E6%9C%89%E6%89%80%E6%9C%89%E6%9C%80%E6%B7%B1%E7%BB%93%E7%82%B9%E7%9A%84%E6%9C%80%E5%B0%8F%E5%AD%90%E6%A0%91/" title="leetcode865. 具有所有最深结点的最小子树">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>三月 22, 2020</p>
        <h3><a href="/2020/03/22/leetcode865-%E5%85%B7%E6%9C%89%E6%89%80%E6%9C%89%E6%9C%80%E6%B7%B1%E7%BB%93%E7%82%B9%E7%9A%84%E6%9C%80%E5%B0%8F%E5%AD%90%E6%A0%91/" title="leetcode865. 具有所有最深结点的最小子树" class="posttitle">leetcode865. 具有所有最深结点的最小子树</a></h3>
        <p>leetcode865. 具有所有最深结点的最小子树

给定一个根为 root 的二叉树，每个结点的深度是它到根的最短距离。


如果一个结点在整个树的任...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/03/22/leetcode449-%E5%BA%8F%E5%88%97%E5%8C%96%E5%92%8C%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91/" title="leetcode449. 序列化和反序列化二叉搜索树">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>三月 22, 2020</p>
        <h3><a href="/2020/03/22/leetcode449-%E5%BA%8F%E5%88%97%E5%8C%96%E5%92%8C%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E4%BA%8C%E5%8F%89%E6%90%9C%E7%B4%A2%E6%A0%91/" title="leetcode449. 序列化和反序列化二叉搜索树" class="posttitle">leetcode449. 序列化和反序列化二叉搜索树</a></h3>
        <p>leetcode449. 序列化和反序列化二叉搜索树

序列化是将数据结构或对象转换为一系列位的过程，以便它可以存储在文件或内存缓冲区中，或通过网络连接链...</p>
    </div>
</div>


<div class="post">
    <a href="/2020/03/22/leetcode863-%E4%BA%8C%E5%8F%89%E6%A0%91%E4%B8%AD%E6%89%80%E6%9C%89%E8%B7%9D%E7%A6%BB%E4%B8%BA-K-%E7%9A%84%E7%BB%93%E7%82%B9/" title="leetcode863. 二叉树中所有距离为 K 的结点">
        <img src="/img/default.png" class="cover" width="680" height="440">
    </a>
    <div class="else">
        <p>三月 22, 2020</p>
        <h3><a href="/2020/03/22/leetcode863-%E4%BA%8C%E5%8F%89%E6%A0%91%E4%B8%AD%E6%89%80%E6%9C%89%E8%B7%9D%E7%A6%BB%E4%B8%BA-K-%E7%9A%84%E7%BB%93%E7%82%B9/" title="leetcode863. 二叉树中所有距离为 K 的结点" class="posttitle">leetcode863. 二叉树中所有距离为 K 的结点</a></h3>
        <p>leetcode863. 二叉树中所有距离为 K 的结点

给定一个二叉树（具有根结点 root）， 一个目标结点 target ，和一个整数值 K 。
...</p>
    </div>
</div>


    </div>
    
    <div id="pager"><a href="/categories/leetcode%E7%99%BE%E9%A2%98%E8%AE%A1%E5%88%92/diaspora/3/" class="more">加载更多</a></div>
    
</div>
<div id="preview"></div>


</body>

<script src="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>


<script src="//lib.baomitu.com/jquery/1.8.3/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/diaspora.js"></script>


<link rel="stylesheet" href="/photoswipe/photoswipe.css">
<link rel="stylesheet" href="/photoswipe/default-skin/default-skin.css">


<script src="/photoswipe/photoswipe.min.js"></script>
<script src="/photoswipe/photoswipe-ui-default.min.js"></script>


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>




</html>
